package com.geostart.constructionland.system.controller;

import java.util.List;
import java.util.Map;

import com.geostart.constructionland.system.service.JspContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.geostart.constructionland.system.dto.JspContentDTO;

import io.swagger.annotations.ApiParam;

/**
 * 获取jsp content
 *
 * @author chenjianjun
 * @since 2020-12-29 17:38
 */
@RestController
public class JspContentController {
    private JspContentService jspContentService;

    @Autowired
    public JspContentController(JspContentService jspContentService) {
        this.jspContentService = jspContentService;
    }

    @PostMapping(value = "/jsp/pdf/jsp-content")
    @ResponseBody
    public ResponseEntity<Map<String, String>> getJspContent(
                    @ApiParam(value = "实体", required = true) @RequestBody List<JspContentDTO> jspContentDTOList) {
        return ResponseEntity.status(HttpStatus.OK).body(jspContentService.getJspContent(jspContentDTOList));
    }
}
